-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support HTTP sender #1383
Conversation
It does not work for me. When I test use above command, the error occur,
|
Please replace |
The server only print this warning, but i have already installed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+
Start server
dbgpt net forward --local-port 5010 \
--remote-host api.chatanywhere.tech \
--remote-port 443 \
--ssl \
--timeout 30
INFO: Started server process [42131]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:5010 (Press CTRL+C to quit)
Forwarding request to https://api.chatanywhere.tech:443/v1/chat/completions
INFO: 127.0.0.1:60158 - "POST /v1/chat/completions HTTP/1.1" 200 OK
Request
export OPENAI_API_BASE=http://127.0.0.1:5010/v1
export OPENAI_API_KEY=sk-xxx
curl $OPENAI_API_BASE/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "hello"
}
],
"stream": true
}'
Response
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" How"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" assist"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":" today"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}]}
data: {"id":"chatcmpl-9Bbh2eIZo5T93ep3dEfy5PyplBDvd","object":"chat.completion.chunk","created":1712553528,"model":"gpt-3.5-turbo-1106","system_fingerprint":"fp_592ef5907d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+
Description
How Has This Been Tested?
make test
Then connect to it.
Snapshots:
Include snapshots for easier review.
Checklist: